
from whiff import resolver
from whiff.middleware import displayTraceback
import gradesApp
import studentInfoResources

def getApp():
    testapp = resolver.moduleRootApplication("/", gradesApp,
                                             exception_middleware=displayTraceback.__middleware__,
                                             on_not_found=None, # show traceback (could comment)
                                             )
    testapp.registerResourceFinder(prefix="grades", finder=studentInfoResources.Finder())
    return testapp

if __name__=="__main__":
    import wsgiref.simple_server
    print "serving drop box test at 8888"
    print "start page at http://localhost:8888/login"
    testapp = getApp()
    srv = wsgiref.simple_server.make_server('localhost', 8888, testapp)
    srv.serve_forever()
                    
